<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8" />
	<title>图</title>
</head>
<body>
	<script src="../../src/Stack.js"></script>
	<script src="../../src/Queue.js"></script>
	<script src="../../src/GraphN.js"></script>
	<script>
		var graph = new GraphN();
		graph.addVertex('A'); // 0
		graph.addVertex('B'); // 1
		graph.addVertex('C'); // 2
		graph.addVertex('D'); // 3
		graph.addVertex('E'); // 4
		graph.addVertex('G'); // 5
		graph.addVertex('H'); // 6
		graph.addVertex('F'); // 7
		graph.addVertex('I'); // 8

		graph.addEdge(0,1);
		graph.addEdge(1,2);
		graph.addEdge(2,3);
		graph.addEdge(0,4);
		graph.addEdge(4,5);
		graph.addEdge(5,6);
		graph.addEdge(0,7);
		graph.addEdge(7,8);

		graph.bfs(function(v){
			console.log(v);
		});
	</script>
</body>
</html>